﻿<Phoenix:PhoenixPage x:Class="HelloWorld.Views.Home.Index"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:Commands="clr-namespace:Phoenix.Commands;assembly=Phoenix"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:Home="clr-namespace:HelloWorld.ViewModels.Home"
                 xmlns:Phoenix="clr-namespace:Phoenix;assembly=Phoenix" mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="696"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="PortraitOrLandscape"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True" d:DataContext="{d:DesignInstance Home:IndexViewModel}">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn" />
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn" />
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut" />
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut" />
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <controls:Pivot Title="PHOENIX SAMPLE APP">
            <controls:PivotItem Header="features">
                <StackPanel>
                    <ListBox>
                        <ListBox.Items>
                            <ListBoxItem Commands:Invoke.OnSelection="Home.NavigationExamples">
                                <TextBlock Text="navigation examples"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                            </ListBoxItem>
                            <ListBoxItem Commands:Invoke.OnSelection="Home.Tombstoning">
                                <TextBlock Text="tombstoning examples"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                            </ListBoxItem>
                            <ListBoxItem Commands:Invoke.OnSelection="Home.ThrowError">
                                <TextBlock Text="error reporting"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                            </ListBoxItem>

                            <ListBoxItem Commands:Invoke.OnSelection="Home.NetworkRequired">
                                <TextBlock Text="network action"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                            </ListBoxItem>
                        </ListBox.Items>
                    </ListBox>
                    
                    <Button Click="ButtonClick"
                            Content="Click me" />
                    
                    <Button Content="Return something to view"
                            Command="{Binding ReturnSomethingCommand}" />                    
                </StackPanel>                
            </controls:PivotItem>            

            <controls:PivotItem Header="diagnostics">
                <ListBox>
                    <ListBox.Items>
                        <ListBoxItem Commands:Invoke.OnSelection="Main.DoesntExist">
                            <TextBlock Text="Controller doesn't exist"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                        </ListBoxItem>
                        <ListBoxItem Commands:Invoke.OnSelection="Main.ViewDoesntExist">
                            <TextBlock Text="View doesn't exist"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                        </ListBoxItem>
                        <ListBoxItem Commands:Invoke.OnSelection="Main.ViewWithExceptions">
                            <TextBlock Text="View with exceptions"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                        </ListBoxItem>
                        <ListBoxItem Commands:Invoke.OnSelection="Main.FatalError">
                            <TextBlock Text="Fatal error"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                        </ListBoxItem>
                    </ListBox.Items>
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True"
                              IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/ApplicationBar.Select.png"
                                            Text="Button 1[ExampleCommand]" />
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/ApplicationBar.Check.png"
                                            Text="Button 2" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1" />
                <shell:ApplicationBarMenuItem Text="MenuItem 2" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</Phoenix:PhoenixPage>